#!/bin/bash

echo '开放端口'
firewall-cmd --zone=public --add-port=1433/tcp --permanent
firewall-cmd --reload

# 运行临时容器
docker run --rm --privileged=true -v /tmp:/tmp mcr.microsoft.com/mssql/server:2022-latest /bin/bash -c "touch /tmp/tmp.txt"
# ll /tmp/tmp.txt
mkdir -p data/mssql2022
chown -R $(ll /tmp/tmp.txt | awk '{print $3}'):$(ll /tmp/tmp.txt | awk '{print $4}') data/mssql2022

echo '启动容器'
docker-compose up -d

echo '查看容器'
docker-compose ps
